{extend name="default/template/base_index" /}


{block name="area_header"}

{/block}

{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}
			
			<!-- 带验证 form -->
			<form class="form-horizontal well validateForm">
				<input name="id"  value="{$vo.id}" type="hidden"/>
				<fieldset>
					<legend>
						会员组编辑表单
					</legend>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">会员组名称</label>
						<div class="col-md-10 col-lg-10">
							<input type="text"  value="{$vo.name}" class="required form-control input-short" name="name" id="name" placeholder="请输入会员组名称">
							<div class="help-block">(会员组名称)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">描述</label>
						<div class="col-md-10 col-lg-10">
							<textarea class="form-control input-short" name="description">{$vo.description}</textarea>
							<div class="help-block">(会员组描述)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="btns" class="col-md-2 col-lg-2 control-label">&nbsp;</label>
						<div class="col-lg-10 col-md-10">
							<a target-form="validateForm" class="ajax-post btn btn-primary" href="{:url(''.CONTROLLER_NAME.'/edit')}" autofocus="autofocus"><i class="fa fa-save"></i> {:L('BTN_SAVE')}</a>
							<a class="btn btn-default" href="{:url(''.CONTROLLER_NAME.'/index')}"><i class="fa fa-times-circle"></i> {:L('BTN_CANCEL')}</a>
						</div>
					</div>
				</fieldset>
			</form>
			<!-- form -->

		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
{/block}

{block name="area_footer"}
	
	<script type="text/javascript" src="__CDN__/jquery-validation/1.13.1/jquery.validate.min.js"></script>
	<script type="text/javascript" src="__CDN__/jquery-validation/1.13.1/localization/messages_zh.min.js"></script>
	<script type="text/javascript">
		$(function() {
			
			$(".validateForm").validate({
				errorPlacement: function(error, element) {
					$(".checked", element.parent()).remove();
					error.appendTo(element.parent());
				},
				success: function(label) {
					label.removeClass("error").addClass("checked").text("Ok!");
				},
				rules: {
					name: {
						required: true,
						maxlength:32,
					},
				},
				messages: {
					name: {
						required: "请输入登录账号",
						maxlength: $.validator.format("账号不能超过{0}个字 符"),
					},
				}
			}); //end validate
		}); //end ready
	</script>
	

{/block}